import React,{useState} from 'react'
import {InfiniteScroll, List} from 'antd-mobile'
import {mockRequest} from './mock-request'
// 无限活力
const App = () => {
    // const [data, setData] = useState([])
    const [value, setValue] = useState(0)
    // const [hasMore,setHasMore] = useState(true)
    // async function loadMore() {
    //     const append = await mockRequest();
    //     setData(val => [...val,...append])
    //     setHasMore(append.length > 0)  //没有数据了
    // }
    const handle = () => {
        setTimeout(() => {
            console.log(value)
        },3000)
    }
    return (
        <div>
            {/* <List>
                {
                    data.map((item,index) => (
                        <List.Item key={index}>{item}</List.Item>
                    ))
                }
            </List>
            <InfiniteScroll loadMore={loadMore} hasMore={hasMore}/> */}
            <button onClick={()=>setValue(value+1)}>加一</button>
            <button onClick={handle}>出来</button>
        </div>
    )
}
export default App